// order/order/logistics/index.js
const app = getApp();
const utils = require('../../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    oid: 0,
    ship:{ShipCoName:'',ShipSN:''},
    list:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      oid: options.oid
    })
    this.getLogistics();
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  getLogistics: function(){
    let that = this;
    wx.request({
      url: app.globalData.host + '/api/order/GetOrderLogistics?oid=' + that.data.oid,
      success: function (res) {
        if (res.data.Code == 0) {
          let data = res.data.Data;
          that.setData({
            list: data.Traces,
            ship:{
              ShipCoName: data.ShipCoName, 
              ShipSN: data.ShipSN
            }            
          })            
        } else {
          utils.showModal(res.data.Message);                
        }
      }
    })
  },

})